import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
import { viteMockServe } from "vite-plugin-mock";

import autoprefixer from "autoprefixer";

export default defineConfig({
  resolve: {
    alias: {
      "@": resolve("src"),
    },
  },
  plugins: [vue(), viteMockServe({})],
  css: {
    postcss: {
      plugins: [autoprefixer],
      // plugins: [postcssImport, tailwindcss],
    },
  },
  server: {
    proxy: {
      "/api": {
        target: "http://xxx.xxx.xx",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },
  },
});
